Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add host option to disable AssemblyLoadContext #172

Merged
merged 1 commit into from
Jan 11, 2024
Merged

Add host option to disable AssemblyLoadContext #172

merged 1 commit into from
Jan 11, 2024

Conversation

mhutch
Copy link
Member

@mhutch mhutch commented Jan 10, 2024

A host can disable the use of AssemblyLoadContext by returning a value of true or 1 when GetHostOption is called with the option name DisableAssemblyLoadContext.

This is an escape hatch for hosts that have issues with the ALC behavior, allowing them to opt out until the underlying issues can be fixed.

Fixes #169

A host can disable the use of AssemblyLoadContext by returning
a value of "true" or "1" when GetHostOption is called with the
option name "DisableAssemblyLoadContext".

This is an escape hatch for hosts that have issues with the ALC
behavior, allowing them to opt out until the underlying issues
can be fixed.
@mhutch
Copy link
Member Author

mhutch commented Jan 10, 2024

@ajcvickers does this fix work for you?

This version also restores the AppDomain codepath and, when ALCs are disabled, uses the AppDomain codepath with the current domain. This means that loading assemblies explicitly referenced by templates will still be supported via the assembly resolve hook.

@mhutch
Copy link
Member Author

mhutch commented Jan 10, 2024

I intend to backport this to the stable 2.3.x release to allow EF Core to update Mono.TextTemplating: dotnet/efcore#32385

@mhutch mhutch merged commit 274037f into main Jan 11, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restore option to load assembly into the current AppDomain
1 participant